/*
 * Copyright @ 2024 weili23
 * com.sky.controller.user 11:08
 * All right reserved.
 */

package com.sky.controller.user;

import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.Result;
import com.sky.service.OrderService;
import com.sky.vo.OrderSubmitVO;
import com.sky.websocket.WebSocketServer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @desc: 订单
 * @author: weili23
 * @createTime: 2024/11/11 11:08
 * @version: v1.0
 */
@RestController("userOrderController")
@Slf4j
@Api(tags = "用户订单管理")
@RequestMapping("/user/order")
public class OrderController {

    @Resource
    private OrderService orderService;


    @ApiOperation("提交订单")
    @PostMapping("/submit")
    public Result<OrderSubmitVO> orderSubmit(@RequestBody OrdersSubmitDTO ordersSubmitDTO){
        OrderSubmitVO vo = orderService.orderSubmit(ordersSubmitDTO);
        return Result.success(vo);
    }
}
